#pragma once
#include"Worker.h"
struct node {
	node() { data = NULL; next = NULL; };
	node(Worker* data) {
		this->data = data;
		this->next = NULL;
	}
	Worker* data;
	node* next;
};
struct list
{
	node* head, * tail;
	int len;
};
class WorkerManager
{
public:
	WorkerManager();
	void showMenu();
	void exitSys();
	void addWorker();
	void showWorker();
	void deleteWorker();
	void editWorker();
	void findWorker();
	void sortedByID();
	void clean();
private:
	list workerList;
	node* addNode(node* p, Worker* data);
	Worker* createWorker(int id, string name, int deptID);
	node* findID(int id);
	node* findName(string name);
	void save();
	void SelectSort(node* head, int op);
	void travel();
};
